package opensource.xinye.com.test11

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.util.Log
import kotlinx.android.synthetic.main.activity_test.*
import opensource.xinye.com.test11.jni.Hello

class TestActivity : AppCompatActivity() {


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_test)

//        Hello().hello()

        Log.i("wangheng",Hello.getStringFromC())

        call_c_static_method.setOnClickListener {
            Log.i("wangheng",Hello.getStringFromC())
//            ServerActivity.launch(this@TestActivity)
        }

        start_client_tcp.setOnClickListener {
            ClientTcpActivity.launch(this@TestActivity)
        }

        start_server_tcp.setOnClickListener {
            ServerTcpActivity.launch(this@TestActivity)
        }

        start_client_udp.setOnClickListener {
            ClientUdpActivity.launch(this@TestActivity)
        }

        start_server_udp.setOnClickListener {
            ServerUdpActivity.launch(this@TestActivity)
        }

//        Hello.testNDKStack()

        Thread.setDefaultUncaughtExceptionHandler { t, e -> e?.printStackTrace() }
    }
}
